import{service} from '@/utils/request'

export function getAllBusiness() {
    return service({
      url: `/api/orgs/ents/get`,
      method: 'get'
    })
}

export function getBusiness(pageNum, pageSize) {
    return service({
      url: `/api/orgs/ents/${pageNum}/${pageSize}`,
      method: 'get'
    })
}
//提交表单显示服务器端出错
export async function addBusiness(data) {
  return await service({
    url: `/api/orgs/ents/`,
    method: 'post',
    data
  })
}

export function searchBusiness(queryInfo) {
  return service({
    url: `/api/orgs/ents/byName/${queryInfo.pageNum}/${queryInfo.pageSize}?name=${queryInfo.query}`,
    method: 'get',
  })
}

export function searchBusinessByCity(queryInfo, id) {
  return service({
    url: `/api/orgs/ents/byCity/${queryInfo.pageNum}/${queryInfo.pageSize}?cityId=${id}`,
    method: 'get',
  })
}

export function updateBusiness(id,data) {
  return service({
    url: `/api/orgs/ents/${id}`,
    method: 'put',
    data
  })
}

export function deleteBusiness(id,data) {
  return service({
    url: `/api/orgs/ents/${id}`,
    method: 'delete',
    data
  })
}

export function importBdDeptdoc(data) {
  return service({
    url: '/api/orgs/ents/excelFile/',  
    method: 'post', 
    data,  
    headers: {  
    'Content-Type': 'multipart/form-data'  
    }  
  })  
}
